Salesforce Library Object

From APA 7.6, the Real-Time Designer provides functionality for connecting directly to Salesforce and handling Salesforce objects. By connecting directly to Salesforce, your solution can query Salesforce using Salesforce Object Query Language (SOQL) and/or Salesforce Object Search Language (SOSL), and then create, delete or update Salesforce objects.

From 7.7, the Salesforce library was expanded to include new functions to upload and download attachments, a function to connect to Salesforce using Webform, and support for compound fields.

A SOQL query is the equivalent of a SELECT SQL statement and searches the org database. SOSL is a programmatic way of performing a text-based search against the search index.

Use SOQL when you know which objects the data resides in, and you want to:

  • Retrieve data from a single object or from multiple objects that are related to one another.

  • Count the number of records that meet specified criteria.

  • Sort results as part of the query.

  • Retrieve data from number, date, or checkbox fields.

Use SOSL when you don’t know which object or field the data resides in, and you want to:

  • Retrieve data for a specific term that you know exists within a field. Because SOSL can tokenize multiple terms within a field and build a search index from this, SOSL searches are faster and can return more relevant results.

  • Retrieve multiple objects and fields efficiently where the objects might or might not be related to one another.

  • Retrieve data for a particular division in an organization using the divisions feature.

For details on incorporating this functionality into your solutions, see Using Salesforce Library.

In the Project tab, the References > Library References includes the Direct.Salesforce.Library

This library includes the following business entities:

  • Salesforce Attachment Info, found in Business Entities > Library Types > Salesforce, which contains the attachment details. For details, see Salesforce Attachment INFO.

  • Salesforce Compound Field, found in Business Entities > Library Types > Salesforce, which contains the compound field details. For details, see Salesforce Compound Field.

  • Salesforce Connection, found in Business Entities > Library Types > Salesforce, which contains the properties and functions you need to establish an authenticated connection with Salesforce. For details, see Salesforce Connection Business Entity

  • Salesforce Object, found in Business Entities > Library Types > Salesforce, which contains the results of the SOQL and SOSL queries. For details, see Salesforce Object Business Entity.

  • A successful connection to Salesforce is a precondition for using the functions that access Salesforce objects. If the connection gets disconnected, you will have to connect again for your solution to continue working.

  • Salesforce, found in Business Entities > Library Types > Salesforce, which contains the properties and functions you need to query Salesforce and create, delete, and update Salesforce objects. For details, see Salesforce Library Functions.

The library is exposed under Project > References > Library References > Salesforce .

Salesforce Attachment INFO

The Salesforce Attachment Info business entity found in Business Entities > Library Types > Salesforce holds the attachment details.

The Salesforce Attachment Info business entity includes the following properties:

Property

Input Type

Description

Attachment Id Text A unique identifier of the attachment.
File Name Text The file name.
File Size Number

The file size.

Last Modified DateTime

The date and time the attachment was last updated.

Salesforce Compound Field

The Salesforce Attachment Info business entity found in Business Entities > Library Types > Salesforce holds the compound field details.

The Salesforce Compound Field business entity includes the following properties:

Property

Input Type

Description

Field Properties List of KeyValuePair A list of key value pairs of the field properties and values.
File Name Text The field name.

Salesforce Connection Business Entity

The Salesforce Connection business entity contains the properties and functions for establishing an authenticated connection with Salesforce. This business entity is found in Business Entities > Library Types > Salesforce.

The Salesforce Connection business entity includes the following properties:

Property

Input Type

Description

Is Connected Boolean A read-only Boolean property that indicates if a connection has been established with Salesforce. The value of this property is updated to True when the connection succeeds, and to False when the connection is disconnected. while the value of this property is False, all the functions that require access to Salesforce objects will fail.

Once you have defined an instance of the Salesforce Connection business entity, use one the following function to connect to the Office 365 server.

Salesforce Object Business Entity

The Salesforce Object business entity found in Business Entities > Library Types > Salesforce holds the query result details.

The Salesforce Object business entity includes the following properties:

Property

Input Type

Description

Attributes List of KeyValuePair A list of key value pairs of the attributes and values.
Id Text A unique identifier of the Salesforce object.
Properties List of KeyValuePair

A list of the object properties and values.

Raw Json Text

A raw JSON string of the result returned by the query.

Salesforce Library Functions

The library functions for accessing and manipulating Salesforce objects are exposed under Library Objects > Salesforce.

A successful connection to Salesforce is a precondition for using the functions that access Salesforce objects. If the connection gets disconnected, you will have to connect again for your solution to continue working.